#!/usr/local/bin/python3
# -*- coding:utf8 -*-
# Author Aaron 
# 2017-04-12 22:44:33
import RPi.GPIO as GPIO
import time

GPIO.setwarnings(False)
GPIO.setmode(GPIO.BOARD)
ina = 7
inb = 11
inc = 13
ind = 15
GPIO.setup(ina, GPIO.OUT)
GPIO.setup(inb, GPIO.OUT)
GPIO.setup(inc, GPIO.OUT)
GPIO.setup(ind, GPIO.OUT)


def setStep(w1, w2, w3, w4):
    GPIO.output(ina, w1)
    GPIO.output(inb, w2)
    GPIO.output(inc, w3)
    GPIO.output(ind, w4)


for i in range(0, 512):
    setStep(0, 0, 0, 1)
    time.sleep(0.001)
    setStep(0, 0, 1, 0)
    time.sleep(0.001)
    setStep(0, 1, 0, 0)
    time.sleep(0.03)
    setStep(1, 0, 0, 0)
    time.sleep(0.001)
GPIO.cleanup()
